package Boundary;

import Auxiliary.Sequence_Type;
import DataView.Sequence_Error;
import DataView.StateObserverInfo;
import Executor.Main;
import Interfaces.ShowStateObserversAndInvariants;
import Store.Element;
import Store.StateObserver;
import Visualization.StateObserverInvVis;

public class UpdateStateObserverInv extends BaseBoundary {
	public StateObserverInvVis currentSOINV;
	public Sequence_Type availableTypes;
	ShowStateObserversAndInvariants interfaccia = new ShowStateObserversAndInvariants(this);
	public Main main;

	public UpdateStateObserverInv(Main main) 
	{
		this.main=main;
	}

	public void mkUpdateStateObserverInv(StateObserverInvVis aCdDVis, Sequence_Type aTypes) 
	{
		currentSOINV=aCdDVis;
		availableTypes=aTypes;
		main.updateProject.home.display(interfaccia.init(), false);
	}

	public void setSOINV(StateObserverInvVis aCdDVis, Sequence_Type aTypes) 
	{
		currentSOINV=aCdDVis;
		availableTypes=aTypes;
		interfaccia.showSOI();
	}

	public void correct(Sequence_Error aErrs) {
		interfaccia.showMessage(aErrs.getDescription());
	}

	public void addStateObserver(StateObserverInfo aEl) 
	{
		main.doAddStateObserver(aEl);
	}

	public void deleteStateObserver(StateObserver aEl) 
	{
		main.doDeleteStateObserver(aEl);
	}
	
	public void validate(Element aEl) 
	{
		main.doValidate(aEl);
	}

	public void updStateObserver(StateObserver aEl, StateObserverInfo aNewElIN) 
	{
		main.doUpdStateObserver(aEl, aNewElIN);
	}

	public void generateBasicSO() 
	{
		main.doGenerateBasicSO();
	}
	
	public void ko() 
	{
		interfaccia.showMessage("Context Class does not Exists");
		interfaccia.showSOI();
	}
	public void close() 
	{
		main.doClose();
	}
}